import Vue from 'vue'
import Router from 'vue-router'
// const MemberList = () => import('./components/member/MemberList.vue');

const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err) };
const originalReplace = Router.prototype.replace;
Router.prototype.replace = function replace(location) { return originalReplace.call(this, location).catch(err => err) };

import layout from './layout'
import Contaniner from '@/components/Contaniner'
Vue.use(Router)

export default new Router({
  //mode: 'history',
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      component: layout,
      meta: { title: '首页', icon: 'dashboard' },
      redirect: '/',
      children: [
        {
          path: '/',
          name: 'Home',
          component: () => import('@/views/home'),
        },
        {
          path: 'flow',
          component: Contaniner,
          children: [{
            path: 'node',
            name: 'FlowNode',
            component: () => import('@/views/flow/node'),
            meta: { title: '节点配置' }

          },
          {
            path: '/',
            name: 'Flow',
            component: () => import('@/views/flow'),
            meta: { title: '事件流配置' }
          }]
        },
        {
          path: 'group',
          name: 'Group',
          component: () => import('@/views/group'),
          meta: { title: '审核组配置' }
        },
        {
          path: 'user',
          name: 'User',
          component: () => import('@/views/user'),
          meta: { title: '审核人配置' }
        },
      ]
    },
  ]
})
